/**
 * Created by Ysssssss on 2021/4/8.
 */

import React, { PureComponent } from 'react';
import {withRouter} from "react-router-dom";
import PageBackHeader from "@common/PageBackHeader";
import PageSubNav from "@common/PageSubNav";
import PRODUCT_NATURE from "@constants/ProductNature";
import {getHistoryMatchParams} from "@utils/setUrlQuery";

@withRouter
class ProductMgtPage extends PureComponent {
    render () {
        const { children } = this.props
        const { productNature } = getHistoryMatchParams(this.props)

        return (
            <div className="bilin-web">
                <PageBackHeader title="商品库" backUrl="/product-center/type"/>
                <PageSubNav
                    navInfoList={[
                        {
                            path: `product-center/product/${productNature}/list`,
                            name: PRODUCT_NATURE[productNature],
                        }, {
                            path: `product-center/product/${productNature}/type`,
                            name: '分类',
                        }, {
                            path: `product-center/product/${productNature}/property`,
                            name: '规格',
                        }
                    ]}
                />
                <div className="bilin-web-right sub">
                    { children }
                </div>
            </div>
        )
    }
}

export default ProductMgtPage